<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.w3.org/1999/xhtml">
<head th:replace="_fragments :: head(~{::title})">
    <meta charset="UTF-8">
    <meta name="viewpoint" content="width=device-width, initial-scale=1.0">
    <title>首页</title>
    <link href="https://cdn.bootcss.com/semantic-ui/2.4.1/semantic.min.css" rel="stylesheet">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.2/animate.min.css" rel="stylesheet">
    <link href="../static/css/myCss.css" rel="stylesheet" th:href="@{/css/myCss.css}">
</head>
<body>
<!--导航-->
<nav th:replace="_fragments :: menu(1)" class="ui inverted attached segment my-padding-tb-mini my-shadow-small">
    <div class="ui container">
        <div class="ui inverted secondary menu stackable">
            <h2 class="ui header teal item">Blog</h2>
            <a href="#"  class="my-item item my-mobile-hide">首页</a>
            <a href="#" class="my-item item my-mobile-hide">标签</a>
            <a href="#" class="my-item item my-mobile-hide">分类</a>
            <a href="#" class="my-item item my-mobile-hide">归档</a>
            <a href="#" class="my-item item my-mobile-hide">关于我</a>

            <div class="right item">
                <div>
                    <div class="ui icon inverted transparent input">
                        <input type="text" placeholder="搜索">
                        <i class="search link icon"></i>

                    </div>
                </div>

                <button class="ui button" style="margin-left: 1em !important;">注册/登陆</button>
            </div>

        </div>
    </div>
    <a href="#" class="menu tooggle ui icon black button my-top-right my-mobile-show"><i class="sidebar icon"></i></a>
</nav>


<div class="my-padding-tb-large">
    <div class="my-container">
        <div class="ui container ">
            <div class="ui grid stackable">
                <!--左边博客列表-->
                <div class="eleven wide column articles animated fadeInUp">
                    <div class="ui segment top attached">
                        <div class="ui middle aligned two column grid">
                            <div class="column">
                                <div class="ui teal header">博客</div>
                            </div>

                            <!--文章总量-->
                            <div class="column right aligned">
                                共 <span id="article-number" class="ui header orange" th:text="${page.totalElements}">需要替代文字</span>篇博客
                            </div>
                        </div>
                    </div>
                    <div class="ui segment attached">

                        <div class="ui vertical segment" th:each="blog : ${page.content}">
                            <div class="ui grid stackable mobile reversed">
                                <!--文章相关信息-->
                                <div class="column">
                                    <!--card article-->
                                    <!--文章题目和简介-->
                                    <h3 class="ui header"><a href="#" th:href="@{/blog/{id}(id=${blog.id})}" target="_blank" class="m-black" th:text="${blog.title}">SpringMVC--二、SpringMVC请求参数绑定和常用注解</a></h3>
                                    <p class="m-text" th:text="|${blog.description}......|">请求参数绑定绑定机制我们都知道，表单中请求参数都是基于key = value的。</p>
                                    <div class="column">
                                        <div class="ui stackable grid">
                                            <div class="eleven wide column">
                                                <div class="ui horizontal link list">

                                                    <!--作者头像和作者名-->
                                                    <div class="item">
                                                        <img src="https://picsum.photos/id/10/100" class="ui avatar image" th:src="@{${blog.user.avatar}}" alt="">
                                                        <div class="content name"><a href="#" th:text="${blog.user.nickname}">张泽</a></div>

                                                    </div>
                                                    <!--文章上传时间-->
                                                    <div class="item">
                                                        <i class="calendar icon"></i><span th:text="${#dates.format(blog.updateTime,'yyyy-MM-dd')}">2017-10-01</span>
                                                    </div>

                                                    <!--浏览量-->
                                                    <div class="item">
                                                        <i class="eye icon"></i> <span th:text="${blog.viewNum}">2342</span>
                                                    </div>
                                                </div>
                                            </div>

                                            <!--文章tag-->
                                            <div class="five wide column right aligned">
                                                <a href="#" target="_blank" class="ui label teal basic" th:text="${blog.type.typeName}">JavaWeb</a>

                                            </div>
                                        </div>
                                    </div>
                                </div>


                            </div>
                        </div>
                    </div>
                    <!--footer-->
                    <div class="ui segment bottom attached " th:if="${page.totalPages}>1">
                        <div class="ui two column grid">
                            <div class="ui column">
                                <a href="#" th:href="@{/(page=${page.number}-1)}"  th:unless="${page.first}" class="ui mini teal basic button">上一页</a>
                            </div>
                            <div class="right aligned column">
                                <a href="#" th:href="@{/(page=${page.number}+1)}"  th:unless="${page.last}" class="ui mini teal basic button">下一页</a>
                            </div>
                        </div>

                    </div>
                </div>

                <!--右边top-->
                <div class="five wide column">
                    <!--分类-->
                    <div class="ui segments animated fadeInUp">
                        <div class="ui secondary segment">
                            <div class="ui two column grid">
                                <div class="column">
                                    <i class="icon idea"></i> 分类
                                </div>
                                <div class="column right aligned">
                                    <a href="#" th:href="@{types/-1}" target="_blank">more <i class="angle double right icon black"></i></a>
                                </div>

                            </div>
                        </div>
                        <div class="ui teal segment">
                            <div class="ui fluid vertical menu">
                                <a href="#" th:href="@{/types/{id}(id=${type.id})}" class="item" target="_blank" th:each="type : ${types}">
                                    <span th:text="${type.typeName}">学习日志</span>
                                    <div class="ui label basic teal left pointing" th:text="${#arrays.length(type.blogs)}">13</div>
                                </a>
                            </div>

                        </div>
                    </div>

                    <!--标签-->
                    <div class="ui segments my-margin-top-large animated fadeInUp">
                        <div class="ui secondary segment">
                            <div class="ui two column grid">
                                <div class="column">
                                    <i class="icon tag"></i> 标签
                                </div>
                                <div class="column right aligned">
                                    <a href="#" th:href="@{tags/-1}" class="" target="_blank">more <i class="angle double right icon black"></i></a>
                                </div>

                            </div>
                        </div>
                        <!--内容-->
                        <div class="ui teal segment">
                            <a href="#" th:href="@{/tags/{id}(id=${tag.id})}" target="_blank" class="ui label basic teal my-margin-tb-tiny" th:each="tag : ${tags}">
                                <span th:text="${tag.tagName}">方法论</span> <div class="detail" th:text="${#arrays.length(tag.blogs)}">23</div>
                            </a>
                        </div>
                    </div>
                    <!--最新推荐-->
                    <div class="ui segments my-margin-top-large animated fadeInUp">
                        <div class="ui secondary segment my-font-color-black">
                            <i class="icon bookmark"></i> 最新推荐
                        </div>
                        <div class="ui segment my-font-color-black" th:each="blog : ${recommendBlogs}">
                            <a href="#" th:href="@{/blog/{id}(id=${blog.id})}" target="_blank" class="my-font-color-black my-font-weight-thin" th:text="${blog.title}">用户故事</a>
                        </div>
                        <!--/*-->
                        <div class="ui segment ">
                            <a href="#" target="_blank" class="my-font-color-black my-font-weight-thin">用户故事</a>
                        </div>

                        <div class="ui segment my-font-color-black">
                            <a href="#" target="_blank" class="my-font-color-black my-font-weight-thin">用户故事</a>
                        </div>
                        <!--*/-->
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/semantic-ui/2.4.1/semantic.min.js"></script>
<script>
    $('.menu.tooggle').click(function () {
        $('.my-item').toggleClass('my-mobile-hide');
    });
</script>
</body>
</html>